
/*
 * AbstractTrigger
 * Abstract class for implementing time-triggered operations
 * Classes extending the AbstractTrigger, implement their own
 * execute() method, which is invoked after the desired triggered time 
 */

public abstract class AbstractTrigger
{
	
	public AbstractTrigger(int ms)
	{
		// runner is a thread class which waits ms milliseconds before invoking execute()
		runner = new TriggerRunner(this, ms);
	}
	
	public void start()
	{
		runner.go();
	}
	
	public void stop()
	{
		runner.halt();
	}
	
	public abstract void execute();
	
	private TriggerRunner runner;
}
